home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D GFX
/
3D GFX.iso
/
amiutils
/
m_p
/
photocdaga
/
src
/
ppm2aga
/
aslscreenmode.c
next >
Wrap
C/C++ Source or Header
|
1995-12-30
|
2KB
|
79 lines
/* Display an ASL screenmode requester */
#include <exec/types.h>
#include <libraries/asl.h>
#include <utility/tagitem.h>
#include "ppm2AGA.h"
#define SMRTITLE ("Select a screen mode")
extern ULONG SMR_DisplayID;
extern ULONG SMR_NumPlanes;
extern ULONG SMR_HAM;
struct Library *AslBase;
extern struct Library *GfxBase;
struct TagItem smrtags[] =
{ { ASLSM_TitleText, SMRTITLE },
{ ASLSM_DoDepth, TRUE },
{ ASLSM_PropertyFlags, DIPF_IS_AA },
{ ASLSM_PropertyMask, DIPF_IS_DUALPF | DIPF_IS_EXTRAHALFBRITE},
{ TAG_DONE, 0 }
};
int ChooseScreenMode()
{
struct ScreenModeRequester *smr;
int ASL_failure=0;
if( AslBase=OpenLibrary("asl.library", 38L) )
{
if(AslBase->lib_Version == 38) smrtags[2].ti_Data = DIPF_IS_ECS;
if( smr = (struct ScreenModeRequester *)
AllocAslRequest(ASL_ScreenModeRequest, smrtags) )
{
if( AslRequest(smr, 0L) )
{
struct DisplayInfo queryinfo;
/* printf("Display type: $%lx\n", smr->sm_DisplayID); */
SMR_DisplayID = smr->sm_DisplayID;
/* printf("Num planes: %ld\n", smr->sm_DisplayDepth); */
SMR_NumPlanes = smr->sm_DisplayDepth;
if(GetDisplayInfoData(NULL, (UBYTE *)&queryinfo, sizeof(queryinfo),DTAG_DISP,SMR_DisplayID))
{
if(queryinfo.PropertyFlags)
{
if(queryinfo.PropertyFlags & DIPF_IS_HAM)
SMR_HAM = 1;
else SMR_HAM = 0;
/* if(SMR_HAM) printf("Mode is HAM\n"); */
}
else ASL_failure = 1;
}
else ASL_failure = 1;
}
else
{
/* printf("User cancelled or error...\n"); */
ASL_failure=1;
}
FreeAslRequest(smr);
}
CloseLibrary(AslBase);
if(!ASL_failure)
return 0;
else
return 1;
}
pm_message("Could not open asl.library V38 or higher.\n");
return 1;
}